/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.nanterre.annuaire.model;

/**
 *
 * @author albran
 */
public class ElementAnnuaire /*implements ElementAffichage*/{
    private int id;
    private String codeApogee;
    private String libelleComplet;
    private String libelleCourt;
    private int parentID;
    private TypeElement type;
   
    

    public ElementAnnuaire() {
    }

    public ElementAnnuaire(int id, String codeApogee, String libelleComplet, String libelleCourt, int parentID, TypeElement type) {
        this.id = id;
        this.codeApogee = codeApogee;
        this.libelleComplet = libelleComplet;
        this.libelleCourt = libelleCourt;
        this.parentID = parentID;
        this.type = type;
    }

    public TypeElement getType() {
        return type;
    }

    public void setType(TypeElement type) {
        this.type = type;
    }

    public String getCodeApogee() {
        return codeApogee;
    }

    public int getId() {
        return id;
    }

    public String getLibelleComplet() {
        return libelleComplet;
    }

    public String getLibelleCourt() {
        return libelleCourt;
    }

    public int getParentID() {
        return parentID;
    }

    public void setCodeApogee(String codeApogee) {
        this.codeApogee = codeApogee;
    }

    public void setId(int id) {
        this.id = id;
    }

    public void setLibelleComplet(String libelleComplet) {
        this.libelleComplet = libelleComplet;
    }

    public void setLibelleCourt(String libelleCourt) {
        this.libelleCourt = libelleCourt;
    }

    public void setParentID(int parentID) {
        this.parentID = parentID;
    }
   
    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof ElementAnnuaire) {
            ElementAnnuaire element = (ElementAnnuaire) obj;
            if (this.getId() == element.getId() && this.getCodeApogee().equals(element.getCodeApogee()) && this.getType().getLabel().equals(element.getType().getLabel())) {
                return true;
            }
        }

        return false;
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 59 * hash + this.id;
        hash = 59 * hash + (this.codeApogee != null ? this.codeApogee.hashCode() : 0);
        hash = 59 * hash + (this.libelleComplet != null ? this.libelleComplet.hashCode() : 0);
        hash = 59 * hash + (this.libelleCourt != null ? this.libelleCourt.hashCode() : 0);
        hash = 59 * hash + this.parentID;
        hash = 59 * hash + (this.type != null ? this.type.hashCode() : 0);
        return hash;
    }
    
    
}
